import 'package:flutter/material.dart';

class LocalNavWidget extends StatelessWidget {
  //定义数据 包含icon 和title
  final List navList = [
    {'icon': Icons.home, 'title': '首页'},
    {'icon': Icons.search, 'title': '搜索'},
    {'icon': Icons.camera_alt, 'title': '旅拍'},
    {'icon': Icons.account_circle, 'title': '我的'},
  ];

  LocalNavWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 60,
      margin: EdgeInsets.fromLTRB(7, 4, 7, 4),
      padding: EdgeInsets.all(6),
      decoration: BoxDecoration(
          color: Colors.white, borderRadius: BorderRadius.circular(6)),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: navList
            .map((e) => Column(
                  children: [Icon(e['icon']), Text(e['title'])],
                ))
            .toList(),
      ),
    );
  }
}
